package com.heima.article.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.article.mapper.AuthorMapper;
import com.heima.article.service.AuthorService;
import com.heima.model.article.pojos.ApAuthor;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuthorServiceImpl extends ServiceImpl<AuthorMapper, ApAuthor> implements AuthorService {
    @Autowired
    private AuthorMapper authorMapper;
    @Override
    public ApAuthor findAuthorByUserId(Integer userId) {
        LambdaQueryWrapper<ApAuthor> wrapper = new LambdaQueryWrapper<ApAuthor>();
        wrapper.eq(ApAuthor::getWmUserId,userId);
        return authorMapper.selectOne(wrapper);
    }
}